package verify

import (
	"awesomeProject/app/request"
	"errors"
)

func PurchasePagination(r *request.PurchasePagination) error {
	if r.PageIndex == 0 {
		r.PageIndex = 1
	}
	if r.PageSize == 0 {
		r.PageSize = 20
	}
	//
	return nil
}

func PurchaseCreate(r *request.PurchaseCreate) error {
	if r.Link == "" {
		return errors.New("链接地址不能为空！")
	}
	return nil
}

func PurchaseUpdate(r *request.PurchaseUpdate) error {
	if r.Link == "" {
		return errors.New("链接地址不能为空！")
	}

	return nil
}
